// Borland C++ Builder
// Copyright (c) 1995, 1999 by Borland International
// All rights reserved

// (DO NOT EDIT: machine generated header) 'DropTarget.pas' rev: 5.00

#ifndef DropTargetHPP
#define DropTargetHPP

#pragma delphiheader begin
#pragma option push -w-
#pragma option push -Vx
#include <ExtCtrls.hpp>	// Pascal unit
#include <Commctrl.hpp>	// Pascal unit
#include <Controls.hpp>	// Pascal unit
#include <Classes.hpp>	// Pascal unit
#include <ActiveX.hpp>	// Pascal unit
#include <Windows.hpp>	// Pascal unit
#include <DropSource.hpp>	// Pascal unit
#include <SysInit.hpp>	// Pascal unit
#include <System.hpp>	// Pascal unit

//-- user supplied -----------------------------------------------------------

namespace Droptarget
{
//-- type declarations -------------------------------------------------------
#pragma option push -b-
enum TScrollDirection { sdHorizontal, sdVertical };
#pragma option pop

typedef Set<TScrollDirection, sdHorizontal, sdVertical>  TScrollDirections;

typedef void __fastcall (__closure *TDropTargetEvent)(System::TObject* Sender, System::TObject* Target
	, Classes::TShiftState ShiftState, const Windows::TPoint &Point, int &Effect);

class DELPHICLASS TDropTarget;
class PASCALIMPLEMENTATION TDropTarget : public Dropsource::TInterfacedComponent 
{
	typedef Dropsource::TInterfacedComponent inherited;
	
private:
	_di_IDataObject fDataObj;
	Dropsource::TDragTypes fDragTypes;
	Controls::TWinControl* fTarget;
	Classes::TList* fTargetList;
	bool fGetDataOnEnter;
	TDropTargetEvent fOnEnter;
	TDropTargetEvent fOnDragOver;
	Classes::TNotifyEvent fOnLeave;
	TDropTargetEvent fOnDrop;
	TDropTargetEvent fGetDropEffectEvent;
	Controls::TImageList* fImages;
	unsigned fDragImageHandle;
	bool fShowImage;
	Windows::TPoint fImageHotSpot;
	Windows::TPoint fLastPoint;
	int fTargetScrollMargin;
	TScrollDirections fScrollDirs;
	Extctrls::TTimer* fScrollTimer;
	Controls::TWinControl* __fastcall GetTarget(const Windows::TPoint &pt);
	void __fastcall DoTargetScroll(System::TObject* Sender);
	void __fastcall SetShowImage(bool Show);
	
protected:
	HRESULT __stdcall DragEnter(const _di_IDataObject DataObj, int grfKeyState, const Windows::TPoint pt
		, int &dwEffect);
	HRESULT __stdcall DragOver(int grfKeyState, const Windows::TPoint pt, int &dwEffect);
	HRESULT __stdcall DragLeave(void);
	HRESULT __stdcall Drop(const _di_IDataObject dataObj, int grfKeyState, const Windows::TPoint pt, int 
		&dwEffect);
	virtual void __fastcall DoEnter(Classes::TShiftState ShiftState, const Windows::TPoint &Point, int 
		&Effect);
	virtual void __fastcall DoDragOver(Classes::TShiftState ShiftState, const Windows::TPoint &Point, int 
		&Effect);
	virtual void __fastcall DoDrop(Classes::TShiftState ShiftState, const Windows::TPoint &Point, int &
		Effect);
	virtual void __fastcall DoLeave(void);
	virtual bool __fastcall DoGetData(void) = 0 ;
	virtual void __fastcall ClearData(void) = 0 ;
	virtual bool __fastcall HasValidFormats(void) = 0 ;
	virtual int __fastcall GetValidDropEffect(Classes::TShiftState ShiftState, const Windows::TPoint &pt
		, int dwEffect);
	
public:
	__fastcall virtual TDropTarget(Classes::TComponent* AOwner);
	__fastcall virtual ~TDropTarget(void);
	void __fastcall Register(Controls::TWinControl* Target);
	void __fastcall UnregisterAll(void);
	void __fastcall Unregister(Controls::TWinControl* Target);
	virtual int __fastcall PasteFromClipboard(void);
	__property _di_IDataObject DataObject = {read=fDataObj};
	__property Controls::TWinControl* Target = {read=fTarget};
	
__published:
	__property Dropsource::TDragTypes Dragtypes = {read=fDragTypes, write=fDragTypes, nodefault};
	__property bool GetDataOnEnter = {read=fGetDataOnEnter, write=fGetDataOnEnter, nodefault};
	__property TDropTargetEvent OnEnter = {read=fOnEnter, write=fOnEnter};
	__property TDropTargetEvent OnDragOver = {read=fOnDragOver, write=fOnDragOver};
	__property Classes::TNotifyEvent OnLeave = {read=fOnLeave, write=fOnLeave};
	__property TDropTargetEvent OnDrop = {read=fOnDrop, write=fOnDrop};
	__property TDropTargetEvent OnGetDropEffect = {read=fGetDropEffectEvent, write=fGetDropEffectEvent}
		;
	__property bool ShowImage = {read=fShowImage, write=SetShowImage, nodefault};
private:
	void *__IDropTarget;	/* IDropTarget */
	
public:
	operator IDropTarget*(void) { return (IDropTarget*)&__IDropTarget; }
	
};


class DELPHICLASS TDropTextTarget;
class PASCALIMPLEMENTATION TDropTextTarget : public TDropTarget 
{
	typedef TDropTarget inherited;
	
private:
	AnsiString fText;
	
protected:
	virtual void __fastcall ClearData(void);
	virtual bool __fastcall DoGetData(void);
	virtual bool __fastcall HasValidFormats(void);
	
public:
	virtual int __fastcall PasteFromClipboard(void);
	__property AnsiString Text = {read=fText, write=fText};
public:
	#pragma option push -w-inl
	/* TDropTarget.Create */ inline __fastcall virtual TDropTextTarget(Classes::TComponent* AOwner) : TDropTarget(
		AOwner) { }
	#pragma option pop
	#pragma option push -w-inl
	/* TDropTarget.Destroy */ inline __fastcall virtual ~TDropTextTarget(void) { }
	#pragma option pop
	
};


//-- var, const, procedure ---------------------------------------------------
extern PACKAGE tagFORMATETC HDropFormatEtc;
extern PACKAGE tagFORMATETC TextFormatEtc;
extern PACKAGE void __fastcall Register(void);
extern PACKAGE Windows::TPoint __fastcall ClientPtToWindowPt(HWND Handle, const Windows::TPoint &pt)
	;
extern PACKAGE bool __fastcall GetFilesFromHGlobal(const unsigned HGlob, Classes::TStrings* Files);

}	/* namespace Droptarget */
#if !defined(NO_IMPLICIT_NAMESPACE_USE)
using namespace Droptarget;
#endif
#pragma option pop	// -w-
#pragma option pop	// -Vx

#pragma delphiheader end.
//-- end unit ----------------------------------------------------------------
#endif	// DropTarget
